﻿
@using WebApp.Models
@model AccountRecordViewModel

<tr>
    <td>@Model.User.UserName</td>
    <td>
        @for (int i = 0, max = (int)ViewBag.MaxRolesCount; i < max; i++)
    {
        
            if (i < Model.User.Roles.Count)
            {
            var role = Model.User.Roles.ElementAt(i);
        <span class="badge bg-color-greenLight">
            @Model.Roles.Single(r => r.Id == role.RoleId).Name
        </span>
            }
       
           
                

}
    </td>
   
        <td>
            @Html.Partial("_AttachRolePartial", new AttachRoleViewModel { UserId = Model.User.Id })
        </td>
        <td>
            @Html.Partial("_DeleteAccountPartial", Model.User)
        </td>
    </tr>

